using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.ObjectBuilder;
using Microsoft.Practices.CompositeWeb;
using System.Transactions;
using GC2.Entities.Logistica;
using GC2.ExceptionHandler.Services;
using GC2.DataAccess.DALogistica;

namespace GC2.Bussines.BMLogistica
{
    public class BMPLogistica
    {
        public BMPLogistica(string coneccion)
        {
            this.Connection = coneccion;
        }

        private string connection = "";
        public string Connection
        {
            get { return connection; }
            set { connection = value; }
        }

        DAPLogistica daPLogistica = new DAPLogistica();
        PLogistica pLogistica = new PLogistica();

        #region BMPLogisticaGet
        public PLogistica BMPLogisticaGet()
        {
            try
            {
                pLogistica = daPLogistica.DAPLogisticaGet(connection);
                return pLogistica;
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion

        #region BMPLogisticaUpdate
        public void BMPLogisticaUpdate(PLogistica pPLogistica)
        {
            try
            {
                daPLogistica.DAPLogisticaUpdate(connection, pPLogistica);
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion
    }
}



